package com.admin.dao.bordao;


import com.borrower.dto.BorrowInfoBean;
import com.pojo.BorInfoBean;
import com.pojo.BorrowerBean;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface BorDao {
    /**
     * 得到借阅者的信息
     * @param sql
     * @param conn
     * @return
     * @throws SQLException
     */
    List<BorrowerBean> getAllBorInfo (String sql, Connection conn) throws SQLException;
    /**
     * @param sql
     * @param conn
     * @return 返回查询到的用户信息集合
     * @throws SQLException
     */
    List<BorrowerBean> getBorInfoByName (String sql, Connection conn, BorrowerBean bor) throws SQLException;

    boolean getIdCardBookNameAddFreeAndTime(String sql,Connection conn,String idCard, String bookName, double renewalFree, String renewalTime) throws SQLException;

    List<BorrowerBean> getBorInfo(String sql, Connection conn) throws SQLException;
    /**
     *
     * @param sql
     * @param conn
     * @param bor
     * @return 返回增加用户余额是否成功
     * @throws SQLException
     */
    boolean updateBorBalance(String sql, Connection conn, BorrowerBean bor) throws SQLException;
    /**
     * 通过传入的Sql语句查找用户信息，所有通过单字段查找用户信息都可用此方法，仅限不能重复字段
     * @param sql
     * @param conn
     * @return
     * @throws SQLException
     */
    BorrowerBean getBorInfoByOther(String sql, Connection conn) throws SQLException;


    /**
     * 书籍的总价值
     * @param sql
     * @param conn
     * @return
     * @throws SQLException
     */

    Double getBooksPriceSum(String sql, Connection conn)throws SQLException;

    /**
     * 借阅的收入
     * @param sql
     * @param conn
     * @return
     * @throws SQLException
     */
    Double    getBorInfoSum(String sql, Connection conn)throws SQLException;



    /**
     * 显示所有用户借书信息
     * @param sql
     * @param conn
     * @return
     * @throws SQLException
     */
    List<BorrowInfoBean> getBorrowInfo(String sql, Connection conn) throws SQLException;

    public boolean updateBorCancel(String sql, Connection conn, BorrowerBean bor) throws SQLException ;




    }
